import React, {Component} from 'react';
import {Relax} from 'iflux2';

@Relax
export default class Title extends Component {

    static defaultProps = {
        fansInfo: []
    }

    render(){

        const { fansInfo } = this.props;

        if(fansInfo.isEmpty()){
            return null
        }

        const { msg_count, new_user, cancel_user, cumulate_user } = fansInfo.last().get(Object.keys(fansInfo.last().toJS())[0]).toJS();
        
        return (
            <ul className="nav">
                <li><span className="num">{msg_count}</span><span className="word">昨日消息数量</span></li>
                <li><span className="num">{new_user}</span><span className="word">昨日新增粉丝</span></li>
                <li><span className="num">{cancel_user}</span><span className="word">昨日跑路粉丝</span></li>
                <li><span className="num">{cumulate_user}</span><span className="word">昨日总粉丝</span></li>
            </ul>
        )
    }
}